/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dilean.bcryptpasswordencoder;

import javax.swing.JLabel;
import javax.swing.JTextField;

/**
 *
 * @author Дмитрий
 */
public class Controller {

    public Controller() {
    }
    
    
    public static void convert(JTextField imp, JTextField out){
        String pass;
        String encPass;
        pass = imp.getText();
        encPass=BCryptEncoder.encode(pass);
        out.setText(encPass);
        
    }
    
    public static void check(JTextField pass, JTextField hashPass, JLabel label){
        String passw = pass.getText();
        String encPassw= hashPass.getText();
        label.setText(BCryptEncoder.matche(passw, encPassw));
        
        
        
    }
    
}
